
import React from 'react';

import './index.less'

import Checkbox from 'bee-checkbox';
import 'bee-checkbox/build/Checkbox.css';

class HeaderCheckbox extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            _checked: false
        };
        this.getCheckState = this.getCheckState.bind(this)
    }

    componentDidMount() {

    }

    componentWillUnmount() {


    }
    onChange = (value) => {
        this.setState({
            _checked: value
        }, () => {
                let { checkboxStateChange } = this.props;
            checkboxStateChange && checkboxStateChange(value)
        })
    }
    getCheckState = () => {
        return this.state._checked
    }
    render() {
        let { _checked } = this.state;
        return (
            <div className='head-checkbox'>
                <span>
                    <Checkbox
                        onChange={this.onChange}
                        checked={_checked}
                    />
                </span>
                <div>显示停用</div>
            </div>
        )
    }
}


export default HeaderCheckbox;